import { request } from "@umijs/max";

// system/menu/list

export const getMenuList = (params?: any) => {
  return request("/api/system/menu/list", {
    method: "GET",
    params,
  });
};
export const getMenuDetail = (id: string | number) => {
  return request(`/api/system/menu/${id}`, {
    method: "GET",
  });
};
// add /system/menu
export const addMenu = (data: any) => {
  return request("/api/system/menu", {
    method: "POST",
    data,
  });
};
// del /system/menu/2002
export const delMenu = (id: string | number) => {
  return request(`/api/system/menu/${id}`, {
    method: "DELETE",
  });
};
// PUT /system/menu
export const updateMenu = (data: any) => {
  return request("/api/system/menu", {
    method: "PUT",
    data,
  });
};
